<!-- Javascript goes in the document HEAD -->
<script type="text/javascript">
function altRows(id){
if(document.getElementsByTagName){

var table = document.getElementById(id);
var rows = table.getElementsByTagName("tr");

for(i = 0; i < rows.length; i++){
if(i % 2 == 0){
rows[i].className = "evenrowcolor";
}else{
rows[i].className = "oddrowcolor";
}
}
}
}


window.onload=function(){
altRows('alternatecolor');
}
</script>




<!-- CSS goes in the document HEAD or added to your external stylesheet -->
<style type="text/css">
table.altrowstable {
font-family: verdana,arial,sans-serif;
font-size:11px;
color:#333333;
border-width: 1px;
border-color: #a9c6c9;
border-collapse: collapse;
}
table.altrowstable th {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
}
table.altrowstable td {
border-width: 1px;
padding: 8px;
border-style: solid;
border-color: #a9c6c9;
}
.oddrowcolor{
background-color:#d4e3e5;
}
.evenrowcolor{
background-color:#c3dde0;
}
</style>




<!-- Table goes in the document BODY -->

{% if response['data']['total'] === 0 %}
    用户列表
{% else %}
    <p align="center">一共 {{ response['data']['total'] }}个 商品 </p>
    <p align="center">
        <a href="/admin/index">返回</a>
        <a href="{{ response['data']['preUrl'] }}">上一页</a>
        <a href="{{ response['data']['nextUrl'] }}">下一页</a>
    </p>
    <div class="mytable">
        <table class="altrowstable" id="alternatecolor">
            <thead>
                <tr>
                    <th>id</th>
                    <th>名称</th>
                    <th>价格(分)</th>
                    <th>优惠券(分)</th>
                    <th>佣金比例</th>
                    <th>佣金(分)</th>
                </tr>
            </thead>
            {% for item in response['data']['list'] %}
                <tbody>
                    <tr>
                        <td> {{ item['goodsId'] }}</td>
                        <td>{{ item['goodsName'] }}</td>
                        <td>{{ item['minGroupPrice'] }}</td>
                        <td>{{ item['couponMinOrderAmount'] }}</td>
                        <td>{{ item['promotionRate']/10 }}%</td>
                        <td>{{ item['promotionRate'] * (item['minGroupPrice'] -item['couponMinOrderAmount']  ) /1000  }}</td>

                    </tr>
                 </tbody>

            {% endfor %}
        </table>
    </div>
{% endif  %}


<form action="/admin/goods/set" method="post">
  设置热门商品，输入商品id "," 分割(如123,143) <br> <input style="width:100%" type="text" name="goodsIds" /><br>
  <input type="submit" value="Submit" />
</form>


